We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Conditions | 2 |
Total Lines | 68 |
Code Lines | 51 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | (function() { |
||
109 | function createRaceRadarChart(race_id) { |
||
110 | |||
111 | var races = { |
||
112 | 1: [[1.0, 1.0, 1.0, 1.0, 1.0], 'Neutral', '#FFD800'], |
||
113 | 2: [[5.2, 10.0, 5.8, 8.1, 5.2], 'Alskant', '#FF00FF'], |
||
114 | 3: [[8.3, 5.0, 10.0, 3.3, 8.3], 'Creonti', '#FF8000'], |
||
115 | 4: [[9.5, 4.9, 9.5, 7.7, 9.5], 'Human', '#0000FF'], |
||
116 | 5: [[8.0, 6.1, 9.7, 10.0, 8.0], 'Ik\'Thorne', '#BFBFFF'], |
||
117 | 6: [[8.1, 4.7, 8.8, 4.3, 8.1], 'Salvene', '#00AA00'], |
||
118 | 7: [[10.0, 5.7, 8.7, 9.1, 10.0], 'Thevian', '#800000'], |
||
119 | 8: [[7.2, 6.3, 7.9, 6.2, 7.2], 'WQ Human', '#804040'], |
||
120 | 9: [[9.5, 4.9, 8.0, 5.1, 9.5], 'Nijarin', '#FF8080'] |
||
121 | }; |
||
122 | |||
123 | var data = [ |
||
124 | { |
||
125 | type: 'scatterpolar', |
||
126 | r: [1.0, 1.0, 1.0, 1.0, 1.0], |
||
127 | theta: ['Hunting', 'Trading', 'Combat', 'Utility', 'Hunting'], |
||
128 | fill: 'toself', |
||
129 | name: 'Neutral', |
||
130 | line: {color: '#FFD800'}, |
||
131 | title: { |
||
132 | text: 'Neutral' |
||
133 | } |
||
134 | } |
||
135 | ]; |
||
136 | |||
137 | var layout = { |
||
138 | showlegend: false, |
||
139 | polar: { |
||
140 | radialaxis: { |
||
141 | visible: true, |
||
142 | showgrid: true, |
||
143 | range: [0, 11], |
||
144 | color: '#fff', |
||
145 | }, |
||
146 | bgcolor: '#111' |
||
147 | }, |
||
148 | paper_bgcolor: '#06240E', |
||
149 | plot_bgcolor: '#000', |
||
150 | font: { |
||
151 | color: '#fff' |
||
152 | }, |
||
153 | coloraxis : '#000' |
||
154 | }; |
||
155 | var check = document.getElementsByClassName('plotly'); |
||
156 | if (check.length == 0) { |
||
157 | Plotly.newPlot('graphframe', data, layout, {staticPlot: true}); |
||
158 | } |
||
159 | Plotly.animate('graphframe', { |
||
160 | data: [{ |
||
161 | r: races[race_id][0], |
||
162 | name: races[race_id][1], |
||
163 | line: {color: races[race_id][2]}, |
||
164 | }], |
||
165 | traces: [0], |
||
166 | layout: {} |
||
167 | }, { |
||
168 | tansition: { |
||
169 | duration: 500, |
||
170 | easing: 'linear' |
||
171 | }, |
||
172 | frame: { |
||
173 | duration: 500 |
||
174 | } |
||
175 | }) |
||
176 | } |
||
177 | // Used by alliance_create.php and alliance_stat.php |
||
189 |